﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CCWin;

using System.IO.Ports;
using System.Text.RegularExpressions;
using System.Threading;
using System.Reflection; // 引用这个才能使用Missing字段
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Xml;
using System.Web;
using System.Runtime.InteropServices;

using System.Net.Sockets;
using System.Net;



using System.IO;


namespace weiqijiance
{
    public partial class ruanjianbanben : CCSkinMain
    {
        // /声明INI文件的写操作函数 WritePrivateProfileString()
        [DllImport("kernel32")]
        private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);

        //声明INI文件的读操作函数 GetPrivateProfileString()
        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
        private string sPath = null;
       public string sxtmc;
        public ruanjianbanben()
        {
            InitializeComponent();
            label1.Text = "";
            label2.Text = "";
            readshezhiXTXX();
            timer1.Enabled = true;
        }
        //ini文件
        public void Ini(string path)
        {
            this.sPath = path;
        }
        public void Writue(string section, string key, string value)
        {
            // section=配置节，key=键名，value=键值，path=路径
            WritePrivateProfileString(section, key, value, sPath);
        }
        public string ReadValue(string section, string key)
        {
            // 每次从ini中读取多少字节
            System.Text.StringBuilder temp = new System.Text.StringBuilder(255);

            // section=配置节，key=键名，temp=上面，path=路径
            GetPrivateProfileString(section, key, "", temp, 255, sPath);
            return temp.ToString();
        }
        //ini文件

        public void readshezhiXTXX()
        {
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\系统信息.ini";
            string path1 = string.Format(@"{0}", path);
            Ini(path1);

            sxtmc = ReadValue("系统信息", "系统名称");
          


        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            //skinLabel1.Text = sxtmc+"   ";
            //skinLabel2.Text = "当前时间:" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss");
            label1.Text = sxtmc + "   ";
            label2.Text = "当前时间:" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss");
        }

        private void skinBut_queding_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            mainform m_af = new mainform("");
            this.Hide();
            m_af.ShowDialog();
        }
    }
}
